#include "OS_gui.h"
void init_monitor(int, char *[]);
void restart();
int ui_mainloop();

int main(int argc, char *argv[]) {

	init_golden();

	/* Initialize the monitor. */
	init_monitor(argc, argv);
	init_Screen();

	/* Test the implementation of the `CPU_state' structure. */
	//reg_test();

	/* Initialize the virtual computer system. */
	restart();

	/* Receive commands from user. */
	int loop_status;
	do{
		loop_status = ui_mainloop();
		if(loop_status == -2){
			del_Screen();
			init_monitor(argc, argv);
			init_Screen();
			GUI_printf(YELLOW_TEXT, "ReStart");
			restart();
		}
	}while(loop_status != -1);
	del_Screen();

	end_golden();

	return 0;
}
